<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	import="convert.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
   <script type="text/javascript"src="My97DatePicker/WdatePicker.js"></script> 
     <table >
			<tr>
				<td>
						开始时间：<input type="text" name="startDate" id="startDate" readonly="readonly" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH',alwaysUseStartDate:true})"/>
				</td>
				<td>
						终止时间：<input type="text" name="endDate" id="endDate" readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH',alwaysUseStartDate:true})"/>
				</td>
				<td>
						选择类型:<select id="id" name="id">
									<option value="1">分层标1</option>
									<option value="2">分层标2</option>
									<option value="3">分层标3</option>
									<option value="4">分层标4</option>
									<option value="5">分层标5</option>
								   </select>
				</td>
				<td>
					<button class = "btn" style="width: 70px;" onclick="init()"><span class="text">统  计</span></button>
				</td>
			</tr>
	</table> 

	<div id="chartContainer2"></div>

	<script type="text/javascript" src="FusionCharts/FusionCharts.js"></script>
	<script type="text/javascript">
	function mySubmit(){
		var startDate = document.getElementById("startDate").value;
		var endDate = document.getElementById("endDate").value;
		var id = document.getElementById("id").value;
		
		document.getElementById("date_value_1").value = startDate;
		document.getElementById("date_value_2").value = endDate;
		document.getElementById("id_value").value = id;			
		//document.getElementById("savevalue").submit();
	}
		var a;
		var b;
	function init() {
		 mySubmit();
			<%
			XMLConvert convert = new XMLConvert();
			String str_date1 = request.getParameter("date_value_1");
			String str_date2 = request.getParameter("date_value_2");
			String str_id = request.getParameter("id_value");
			int id =1;
			if(str_id!=null)
				 id = Integer.parseInt(str_id);
			%>
		
		var xml =<%='"'%><%=convert.getFusionChartsXML(str_date1, str_date2,id)%><%='"'%>;
		var chart = new FusionCharts("FusionCharts/Line.swf", "myChartId",
				"800", "600");
		chart.setDataXML(xml);
		chart.render("chartContainer2");
		}

	</script>
	<form method="post" id="savevalue">
		<input id='date_value_1' type='hidden' name="date_value_1"> 
		<input id='date_value_2' type='hidden' name="date_value_2">
		<input id='id_value' type='hidden' name="id_value">
	</form>
</body>
</html>
